function Person (name, age, gender) {
  Person.prototype.name = name;
  Person.prototype.age = age;
  Person.prototype.gender = gender;
  Person.prototype.sayName = function () {
    console.log(this.name);
  };
}

var p1 = new Person('zhangsan', 12, 'male')
console.log(p1.name);
var p2 = new Person('lisi', 12, 'male')
console.log(p2.name);
p1.sayName()
p2.sayName()
console.log(p1.sayName === p2.sayName);